#include "fast_stm.h"
#include "transaction.h"
#include "transaction_queue.h"

transaction_t::transaction_t() : state_(TRANSACTION_NULL)
{
}

bool transaction_t::restart()
{
	return (state_==TRANSACTION_RESTART) || (state_==TRANSACTION_START);
}

bool transaction_t::committed()
{
	return (state_==TRANSACTION_COMMIT);
}

void transaction_t::start()
{
	state_ = TRANSACTION_START;
	g_transaction_queue->start_transaction(this);
}

void transaction_t::end()
{
	state_ = TRANSACTION_COMMIT;
	g_transaction_queue->end_transaction(this);
}


